Release 10.1A: OpenEdge Getting Started:
Object-oriented Programming


Using the root class — Progress.Lang.Object

Progress.Lang.Object is a Progress built-in class definition that is the ultimate super class (root class) for all classes. In other words, if a class does not inherit from another class it implicitly inherits from Progress.Lang.Object. Thus, at the top of every class inheritance chain is the Progress.Lang.Object class.

Progress.Lang.Object provides a common set of data members and methods that are available for an instance of any class.

Note: These data members and methods provide support for class-based objects that is similar to the support provided by the 4GL internal attributes and methods on handles to procedure-based objects.

Table 2–2 describes the common data members and methods on Progress.Lang.Object.

Table 2–2: Progress.Lang.Object public data members and methods
Data member or method
Description
PUBLIC NEXT-SIBLING AS CLASS 
Progress.Lang.Object 
A read-only data member that contains an object reference to the next object in the linked list of instantiated objects for the session. This data member is critical to the function of a Progress session and cannot be overridden. You use this data member together with the FIRST-OBJECT attribute on the SESSION system handle in order to walk the list from the first to the last instantiated object.
PUBLIC PREV-SIBLING AS CLASS 
Progress.Lang.Object 
A read-only data member that contains an object reference to the previous object in the linked list of instantiated objects for the session. This data member is critical to the function of a Progress session and cannot be overridden.You use this data member together with the LAST-OBJECT attribute on the SESSION system handle in order to walk the list from the last to the first instantiated object.
CONSTRUCTOR PUBLIC Object ( ) 
Constructor for this class. You can instantiate Progress.Lang.Object, but its functionality is limited to the public data members and methods defined in this table. This class is normally used to define a variable or parameter that can represent any class-based object in the 4GL (because all class-based objects inherit from Progress.Lang.Object).
METHOD PUBLIC CLASS Progress.Lang.Class 
GetClass ( ) 
Returns an object reference to a built-in instance of Progress.Lang.Class that provides type information for the current class instance. Each Progress session contains a single instance of Progress.Lang.Class for each type of class-based object created in the session. The lifetime of this built-in object is controlled by the Progress session and therefore cannot be deleted. For more information on the built-in class, Progress.Lang.Class, see the "Reflection — using the Progress.Lang.Class class" section.
METHOD PUBLIC CHARACTER ToString ( ) 
Returns the type name of the object followed by a unique object identifier in the Progress session. This method is normally overridden by a subclass.
METHOD PUBLIC LOGICAL Equals  
( other-obj AS CLASS Progress.Lang.Object ) 
Has no default behavior and returns the Unknown value (?) and an error message if it is invoked and not overridden by a subclass. The subclass should define a method to determine if two different object references are equivalent and return TRUE or FALSE depending on the result. The two objects to compare are the current object instance and the object instance referenced by other-obj.

Note: Use the equals operator (EQ or =) to determine if the two object reference point to the same object.

METHOD PUBLIC CLASS Progress.Lang.Object 
Clone ( ) 
Has no default behavior and returns the Unknown value (?) and an error message if it is invoked and not overridden by a subclass. The subclass should define a method to create a copy of an object and return a reference to the new copy.

Because every object ultimately derives from Progress.Lang.Object, you can define an object reference with the data type Progress.Lang.Object and set it to reference any class-based object that you create in a Progress session. As with any object reference, the use of a Progress.Lang.Object object reference is limited to the data members and methods defined for Progress.Lang.Object. However, you can cast any object reference to an appropriate subclass to access functionality in that subclass. For more information on casting, see the "Assignment and the CAST function" section


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095